var counter=0;
function HeightController(flag){
	var LPBox = document.getElementById("leftPanel");
	var RPBox = document.getElementById("rightPanel");
	var EDBox = document.getElementById("editPanel");
	var panelHeightData = new Cookie(document, "panelHeight", 2400);
	if(0==counter){
		LPBox.style.height="400px";
		RPBox.style.height="400px";
		EDBox.style.height="400px";
	}
	if(flag=="+"){
		LPBox.style.height = getHeight(LPBox)+50+"px";
		RPBox.style.height = getHeight(RPBox)+50+"px";
		EDBox.style.height = getHeight(EDBox)+50+"px";
		panelHeightData.panelHeight = LPBox.style.height;
		panelHeightData.store();
	}else if(flag=="-"){
		LPBox.style.height = getHeight(LPBox)>50 ? getHeight(LPBox)-50+"px" : LPBox.style.height;
		RPBox.style.height = getHeight(RPBox)>50 ? getHeight(RPBox)-50+"px" : RPBox.style.height;
		EDBox.style.height = getHeight(EDBox)>50 ? getHeight(EDBox)-50+"px" : EDBox.style.height;
		panelHeightData.panelHeight = LPBox.style.height;
		panelHeightData.store();
	}
	counter++;	
}

function getHeight(obj){
	var height;
	height=parseInt(obj.style.height.substring(0,obj.style.height.indexOf('p')));
	return height;
}

function initHeight(){
	var panelHeightData = new Cookie(document, "panelHeight", 2400);
	if(!panelHeightData.load() || !panelHeightData.panelHeight){
		panelHeightData.panelHeight = "400px";
	}

	var LPBox = document.getElementById("leftPanel");
	var RPBox = document.getElementById("rightPanel");
	var EDBox = document.getElementById("editPanel");

	LPBox.style.height = panelHeightData.panelHeight;
	LPBox.style.height = panelHeightData.panelHeight;
	LPBox.style.height = panelHeightData.panelHeight;
}